package callnumber.gtdev5.com.photoVault.utils;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;

import com.gtdev5.geetolsdk.mylibrary.util.MobileInfoUtils;

/**
 * Created by Administrator on 2018\3\26 0026.
 * 后台智能清理管理白名单工具
 */

public class BackGroundManagerUtils {



    public static Intent jumpStartInterface(Context context) {
        Intent intent = new Intent();
        try {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            ComponentName componentName = null;
            if (MobileInfoUtils.getMobileType().equals("Xiaomi")) {
                //小米7.0测试通过
                componentName = new ComponentName("com.miui.securitycenter", "com.miui.optimizemanage.MainActivity");

            } else if (MobileInfoUtils.getMobileType().equals("HUAWEI")) {
                // 华为测试通过
                componentName = new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.spacecleanner.SpaceCleanActivity");
            }

            if (componentName != null) {
                intent.setComponent(componentName);
                return intent;
            } else {
                return null;
            }

        } catch (Exception e) {
            return null;
        }
    }

    public static boolean isNeedSetPhone() {
        switch (MobileInfoUtils.getMobileType()) {
            case "Xiaomi":
            case "HUAWEI":
                return true;

            default:
                return false;
        }

    }
}
